import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import jason.environment.grid.GridWorldModel;
import jason.environment.grid.GridWorldView;


public class AmbienteView extends GridWorldView {

	public AmbienteView(GridWorldModel model, String title, int windowSize) {
		super(model, title, windowSize);
		
        defaultFont = new Font("Arial", Font.BOLD, 18); // change default font
        setVisible(true);
        repaint();
	}
	
	/** draw application objects */
    @Override
    public void draw(Graphics g, int x, int y, int object) {
    	switch (object) {
    		case 8 : drawEmpecilho(g, x, y, Color.RED);  break;
    		case 16 : drawEmpecilho(g, x, y, Color.GREEN);  break;
    		case 32 : drawEmpecilho(g, x, y, Color.GRAY);  break;
    	}
    	
    }

    @Override
    public void drawAgent(Graphics g, int x, int y, Color c, int id) {
        String label = "Asp";
        if (id == 0) {
        	c = Color.blue;
        } else if (id == 1) {
        	c = Color.green;
        }
//        if (id == 0) {
//            c = Color.green;
//            if (((MarsModel)model).r1HasGarb) {
//                label += " - G";
//                c = Color.orange;
//            }
//        }
        super.drawAgent(g, x, y, c, -1);
//        if (id == 0) {
//            g.setColor(Color.black);
//        } else {
//            g.setColor(Color.white);                
//        }
        super.drawString(g, x, y, defaultFont, label);
    }

    public void drawEmpecilho(Graphics g, int x, int y, Color color) {
        super.drawObstacle(g, x, y);
        g.setColor(color);
        drawString(g, x, y, defaultFont, "P");
    }
	
	
}


